-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document .graphql and .gql file loading with graphql.macro #5481
Conversation
This should probably target the docs too https://github.com/facebook/create-react-app/blob/master/docusaurus/docs/ |
Signed-off-by: petetnt <pete.a.nykanen@gmail.com>
67c3941
to
36353be
Compare
Aaaand now it targets the docusaurus docs 🦎 |
sidebar_label: Loading .graphql Files | ||
--- | ||
|
||
You can load `.gql` and `.graphql` files by using [`babel-plugin-macros`](https://github.com/kentcdodds/babel-plugin-macros) included with Create React App. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's skip the part talking about macros and just combine these two sentences.
@Timer addressed comments, thanks! |
Shouldn't this come right after Relay docs? |
Adding loading other types of assets (images, svgs, styles...) are on that section and AFAIK the Anyway is fine with me, you can take the pick 😄 |
Alternatively you may use `yarn`: | ||
|
||
```sh | ||
yarn add graphql-tag.macro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant graphql.macro
rather than graphql-tag.macro
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a ton @AndresRodH ! You are totally right, graphql.macro
offers both the gql
and the loader
while graphql-tag
only has the tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed this one! 😆yarn add graphql.macro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hahaa 🤦♂️ maybe it's fixed now. I blame the GitHub editor and doing changes on the go 😂
Thanks @AndresRodH for reviewing! |
Just going to throw this out there, I made a PR which adds support for this, but, it looks like I am also somewhat concerned because it does not look like the repository is being actively maintained, I made a fork with absolute path and node modules path support at @kimmel/graphql.macro to use for now with the hope that the maintainer will become active. |
Co-Authored-By: petetnt <pete.a.nykanen@gmail.com>
Co-Authored-By: petetnt <pete.a.nykanen@gmail.com>
Good catch @donovantc, fixed! |
It seems that @audiolion's comment has been addressed in |
The deploy preview seems to be broken. Can you try rebasing with master to see if that fixes it? |
This PR follows up #3909 and #5076 by adding documentation for the
.graphql
loading features throughbabel-plugin-macros
.Signed-off-by: petetnt pete.a.nykanen@gmail.com